package cn.john.hrm.service.impl;

import cn.john.hrm.domain.Employee;
import cn.john.hrm.domain.UserContextInfo;
import cn.john.hrm.mapper.EmployeeMapper;
import cn.john.hrm.service.IEmployeeService;
import cn.john.hrm.util.AjaxResult;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author john
 * @since 2021-06-17
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements IEmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public AjaxResult getUserInfo(Long loginId) {
        UserContextInfo userInfo = employeeMapper.getUserInfo(loginId);
        return AjaxResult.me().setResultObj(userInfo);
    }
}
